<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>ViewportDepthNode - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
		<p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → </p>
	<h1 translate="no">ViewportDepthNode</h1>
		<section>
			<header>
				<div class="class-description"><p>This node offers a collection of features in context of the depth logic in the fragment shader.
Depending on <a href="ViewportDepthNode.html#scope">ViewportDepthNode#scope</a>, it can be used to define a depth value for the current
fragment or for depth evaluation purposes.</p></div>
			</header>
			<article>
				<div class="container-overview">
					<h2>Constructor</h2>
					<h3 class="name name-method" id="ViewportDepthNode" translate="no">new <a href="#ViewportDepthNode">ViewportDepthNode</a><span class="signature">( scope : <span class="param-type">'depth' | 'depthBase' | 'linearDepth'</span>, valueNode : <span class="param-type"><a href="Node.html">Node</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Constructs a new viewport depth node.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>scope</strong>
									</td>
									<td class="description last">
										<p>The node's scope.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>valueNode</strong>
									</td>
									<td class="description last">
										<p>The value node.</p>
										<p>Default is <code>null</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<h2 class="subsection-title">Properties</h2>
				<div class="member">
					<h3 class="name" id="isViewportDepthNode" translate="no">.<a href="#isViewportDepthNode">isViewportDepthNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
					<div class="description">
						<p>This flag can be used for type testing.</p>
						<p>Default is <code>true</code>.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="scope" translate="no">.<a href="#scope">scope</a><span class="type-signature"> : 'depth' | 'depthBase' | 'linearDepth'</span> </h3>
					<div class="description">
						<p>The node behaves differently depending on which scope is selected.</p>
<ul>
<li><code>ViewportDepthNode.DEPTH_BASE</code>: Allows to define a value for the current fragment's depth.</li>
<li><code>ViewportDepthNode.DEPTH</code>: Represents the depth value for the current fragment (<code>valueNode</code> is ignored).</li>
<li><code>ViewportDepthNode.LINEAR_DEPTH</code>: Represents the linear (orthographic) depth value of the current fragment.
If a <code>valueNode</code> is set, the scope can be used to convert perspective depth data to linear data.</li>
</ul>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="valueNode" translate="no">.<a href="#valueNode">valueNode</a><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
					<div class="description">
						<p>Can be used to define a custom depth value.
The property is ignored in the <code>ViewportDepthNode.DEPTH</code> scope.</p>
						<p>Default is <code>null</code>.</p>
					</div>
				</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/display/ViewportDepthNode.js" translate="no" target="_blank" rel="noopener">src/nodes/display/ViewportDepthNode.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>